<demo>
    常规使用
</demo>
<template>
    <Button @click="toggle">toggle</Button>
    <Dialog v-model:visible="show" 
        :onClickOverlay="false" 
        :OK="f1"
        :Cancel="f2"
    >
        <template v-slot:content>
            <strong>h1</strong>
            <div>天气不错</div>
        </template>
        <template v-slot:title >
            <strong>加粗标题</strong>
        </template>
    </Dialog>
</template>
<script lang="ts">
    import Dialog from "../lib/Dialog.vue";
    import Button from "../lib/Button.vue";
    import { ref } from 'vue';
    import { openDialog } from "../lib/Opendialog";
    export default {
    components: { Dialog , Button },
    setup(){
        const show = ref(false);
        const toggle = () => {
            show.value = !show.value 
        }
        const f1 = () => {
            console.log(1);
            return false
        }
        const f2 = () => {
            console.log(2);
        }
        const showDialog = () => {
            openDialog({
                title: '标题',
                content: '你好',
                OK() {
                    console.log('ok');
                    
                },
                Cancel() {
                    console.log('cancel');
                    
                },
            })
        }
        return {
            show,
            toggle,
            f1,
            f2,
            showDialog
        }
    }
}
</script>